import base64
import hashlib


def get_report_psw(report_code):
    password = "cx_admin_secure_password_123!".encode()
    salt = b'fixed_salt_for_deterministic_encryption'
    key = hashlib.pbkdf2_hmac('sha256', password, salt, 100000, dklen=32)
    
    # 使用HMAC作为"加密"（实际是带密钥的哈希）
    hmac = hashlib.pbkdf2_hmac('sha256', key, report_code.encode(), 1, dklen=16)
    
    psw_str = base64.urlsafe_b64encode(hmac).decode().rstrip('=')
    return psw_str